﻿@{
	string FlowID = Request.QueryString["flowid"];
	string StepID = Request.QueryString["stepid"];
	string GroupID = Request.QueryString["groupid"];
	string TaskID = Request.QueryString["taskid"];
	string InstanceID = Request.QueryString["instanceid"];
	string DisplayModel = Request.QueryString["display"] ?? "0";
	string DBConnID = "06075250-30dc-4d32-bf97-e922cb30fac8";
	string DBTable = "OaEvection";
	string DBTablePK = "ID";
	string DBTableTitle = "";
	if(InstanceID.IsNullOrEmpty()){InstanceID = Request.QueryString["instanceid1"];}
	YJ.Platform.Dictionary BDictionary = new YJ.Platform.Dictionary();
	YJ.Platform.WorkFlow BWorkFlow = new YJ.Platform.WorkFlow();
	YJ.Platform.WorkFlowTask BWorkFlowTask = new YJ.Platform.WorkFlowTask();
	string fieldStatus = BWorkFlow.GetFieldStatus(FlowID, StepID);
	LitJson.JsonData initData = BWorkFlow.GetFormData(DBConnID, DBTable, DBTablePK, InstanceID, fieldStatus, "{\"oaevection.declaredate\":\"yyyy-MM-dd\"}");
	string TaskTitle = BWorkFlow.GetFromFieldData(initData, DBTable, DBTableTitle);
}
<link href="~/Scripts/FlowRun/Forms/flowform.css" rel="stylesheet" type="text/css" />
<script src="~/Scripts/FlowRun/Forms/common.js" type="text/javascript" ></script>
<input type="hidden" id="Form_ValidateAlertType" name="Form_ValidateAlertType" value="1" />
<input type="hidden" id="OaEvection." name="OaEvection." value="@(TaskTitle.IsNullOrEmpty() ? BWorkFlow.GetAutoTaskTitle(FlowID, StepID, Request.QueryString["groupid"]) : TaskTitle)" />
<input type="hidden" id="Form_TitleField" name="Form_TitleField" value="OaEvection." />
<input type="hidden" id="Form_DBConnID" name="Form_DBConnID" value="06075250-30dc-4d32-bf97-e922cb30fac8" />
<input type="hidden" id="Form_DBTable" name="Form_DBTable" value="OaEvection" />
<input type="hidden" id="Form_DBTablePk" name="Form_DBTablePk" value="ID" />
<input type="hidden" id="Form_DBTableTitle" name="Form_DBTableTitle" value="" />
<input type="hidden" id="Form_AutoSaveData" name="Form_AutoSaveData" value="1" />
<textarea id="Form_DBTableTitleExpression" name="Form_DBTableTitleExpression" style="display:none;width:0;height:0;"></textarea>
<script type="text/javascript">
	var initData = @Html.Raw(BWorkFlow.GetFormDataJsonString(initData));
	var fieldStatus = "1"=="@Request.QueryString["isreadonly"]" ? {} : @Html.Raw(fieldStatus);
	var displayModel = '@DisplayModel';
	$(window).load(function (){
		formrun.initData(initData, "OaEvection", fieldStatus, displayModel);
	});
</script>
<script type="text/javascript">function typeHide()
    {
        var isCity = document.getElementsByTagName("OaEvection.IsQuickCity");
        if (isCity.length == 0) {
            $("label").each(function () {
                var labelval = $(this).html().trim();
                if (labelval == '其他城市') {
                    document.getElementById("EveCity").style.display = "";
                    document.getElementById("QuickCity").style.display = "none";
                }
            });
        }}</script><p><br/></p><p><span class="txt"><input type="hidden" id="OaEvection.Name" name="OaEvection.Name" isflow="1" type1="flow_hidden" value="u_@(new YJ.Platform.WorkFlowTask().GetFirstSnderID(FlowID.ToGuid(), GroupID.ToGuid(), true))"/></span></p><link href="~/Content/Theme/tablenew.css?version=201811161405" rel="stylesheet"/><table class="flowformtable tableF table table-bordered" data-sort="sortDisabled" cellspacing="1" cellpadding="0"><tbody><tr class="firstRow"><th rowspan="1" colspan="2" valign="middle" align="center"><span class="title">出差申请表</span></th></tr><tr><th class="titleT" rowspan="1" colspan="2" valign="middle" align="left"><p class="titleO">基本信息</p></th></tr><tr class="topTr"><td class="top" rowspan="1" colspan="1" valign="middle"><p class="txt">申报日期</p><input type="text" type1="flow_datetime" id="OaEvection.DeclareDate" name="OaEvection.DeclareDate" value="@(YJ.Utility.DateTimeNew.LongDate)" format="yyyy-MM-dd" defaultvalue="%40(YJ.Utility.DateTimeNew.LongDate)" istime="0" daybefor="0" dayafter="0" currentmonth="0" isflow="1" class="mycalendar" title=""/></td><td class="top" rowspan="1" colspan="1" valign="left"><p class="txt">申报部门</p><input type="text" type1="flow_org" id="OaEvection.DeclareSection" name="OaEvection.DeclareSection" value="@(YJ.Platform.Users.CurrentUnitID)" style="width:55%" more="0" isflow="1" class="mymember" title="" dept="1" station="0" user="0" workgroup="0" unit="1" rootid="04f12beb-d99d-43df-ac9a-3042957d6bda"/></td></tr><tr><td rowspan="1" colspan="1" valign="middle" align="left"><p class="txt">出差人</p><input type="text" type1="flow_org" id="OaEvection.Evection" name="OaEvection.Evection" value="u_@YJ.Platform.Users.CurrentUserID.ToString()" style="width:55%" more="1" isflow="1" class="mymember" title="" dept="0" station="0" user="1" workgroup="0" unit="0" rootid="04f12beb-d99d-43df-ac9a-3042957d6bda"/></td><td rowspan="1" colspan="1" style="word-break: break-all;" valign="top"><p class="txt">事由</p><textarea isflow="1" type1="flow_textarea" id="OaEvection.Cause" name="OaEvection.Cause" class="mytext" style="width:63%; height:40px;"></textarea></td></tr><tr class="topTr bottomTr"><td class="bottom" style="word-break: break-all;" rowspan="1" colspan="2" valign="middle" align="left"><div><script type="text/javascript">function subtable_addrow_OaEvectionList_ID_ID_EvectionID(){var subtableid = "OaEvectionList_ID_ID_EvectionID";var instanceid = "@InstanceID";var tabid = '@Request.QueryString["tabid"]';var appid = '@Request.QueryString["appid"]';if($.trim(instanceid).length==0){alert("请先保存主表数据再添加!");return;}new RoadUI.Window().open({url:"/WorkFlowRun/SubTableEdit?editmodel=1&flowid=@FlowID&stepid=@StepID&secondtableeditform=f5f364ff-080d-4ea3-af36-c6c12a2d07e8&primarytableid=" + instanceid + "&secondtablerelationfield=OaEvectionList.EvectionID&appid="+appid,openerid:tabid,title:"添加",height:500,width:800});}function subtable_editrow_OaEvectionList_ID_ID_EvectionID(id, display){var subtableid="OaEvectionList_ID_ID_EvectionID";var instanceid="@Request.QueryString["instanceid"]";var tabid='@Request.QueryString["tabid"]';var appid = '@Request.QueryString["appid"]';new RoadUI.Window().open({url:"/WorkFlowRun/SubTableEdit?editmodel=1&flowid=@FlowID&stepid=@StepID&secondtableeditform=f5f364ff-080d-4ea3-af36-c6c12a2d07e8&secondtable=OaEvectionList&secondtableconnid=@DBConnID&secondtableprimarykey=ID&instanceid="+id+"&primarytableid="+instanceid+"&secondtablerelationfield=OaEvectionList.EvectionID&appid="+appid+"&display=" + (display || ""),openerid:tabid,title:1==display ? "查看" : "编辑",height:500,width:800});}function subtable_deleterow_OaEvectionList_ID_ID_EvectionID(id){var subtableid = "OaEvectionList_ID_ID_EvectionID";var instanceid = "<%=InstanceID%>";var tabid = '@Request.QueryString["tabid"]';var appid = '@Request.QueryString["appid"]';if(!confirm("您真的要删除该记录吗?")){return;}$.ajax({url:"/WorkFlowRun/SubTableDelete?secondtableeditform=f5f364ff-080d-4ea3-af36-c6c12a2d07e8&secondtableconnid=@DBConnID&secondtable=OaEvectionList&secondtableprimarykey=ID&secondtablepkvalue="+id+"&appid="+appid,async:false,cache:false,success:function(txt){alert(txt);window.location=window.location;}});}$(function(){var isdisplay = '1'=='@Request.QueryString["display"]';var OaEvectionList_Status=(fieldStatus.oaevectionlist_id||"").split('_');if(OaEvectionList_Status.length>0 || isdisplay){var OaEvectionList_Status1=OaEvectionList_Status[0];if("1"==OaEvectionList_Status1 || "2"==OaEvectionList_Status1 || isdisplay){$("#subtable_OaEvectionList_ID_ID_EvectionID thead tr th:last input").remove();$("#subtable_OaEvectionList_ID_ID_EvectionID tbody tr").each(function(){$("td:last input:last",$(this)).remove();$("td:last input:first",$(this)).attr("value","查看").removeAttr("onclick").bind("click",function(){subtable_editrow_OaEvectionList_ID_ID_EvectionID($(this).attr("data-id"),1);});});}}});</script><table class="flowformsubtable" data-showindex="0" data-sortstring="" style="width:99%;margin:0 auto;" cellPadding="0" cellspacing="1" issubflowtable="1" id="subtable_OaEvectionList_ID_ID_EvectionID"><thead><tr><th style="text-align:left;">开始日期</th><th style="text-align:left;">结束日期</th><th style="text-align:left;">出差天数</th><th style="text-align:left;">住宿天数</th><th style="text-align:left;">省</th><th style="text-align:left;">市</th><th style="text-align:left;">区</th><th style="text-align:left;">距离</th><th style="text-align:left;">交通工具</th><th style="width:10%; text-align:left;"><input type="button" class="mybutton" value="添加" onclick="subtable_addrow_OaEvectionList_ID_ID_EvectionID();"/></th></tr></thead><tbody>@{System.Data.DataTable Dt_OaEvectionList_ID_ID_EvectionID = new YJ.Platform.DBConnection().GetDataTable(DBConnID, "OaEvectionList","EvectionID", InstanceID, "");YJ.Platform.WorkFlowForm bWorkFlowForm_OaEvectionList_ID_ID_EvectionID = new YJ.Platform.WorkFlowForm();int showIndex = 0;foreach(System.Data.DataRow dr in Dt_OaEvectionList_ID_ID_EvectionID.Rows){<tr><td data-title="开始日期" >@bWorkFlowForm_OaEvectionList_ID_ID_EvectionID.GetDisplayString(dr["StartDate"].ToString(), "datetime_format", "yyyy-MM-dd   HH:mm", DBConnID, "" )</td><td data-title="结束日期" >@bWorkFlowForm_OaEvectionList_ID_ID_EvectionID.GetDisplayString(dr["EndDate"].ToString(), "datetime_format", "yyyy-MM-dd   HH:mm", DBConnID, "" )</td><td data-title="出差天数" >@bWorkFlowForm_OaEvectionList_ID_ID_EvectionID.GetDisplayString(dr["Days"].ToString(), "normal", "", DBConnID, "" )</td><td data-title="住宿天数" >@bWorkFlowForm_OaEvectionList_ID_ID_EvectionID.GetDisplayString(dr["HouseDays"].ToString(), "normal", "", DBConnID, "" )</td><td data-title="省" >@bWorkFlowForm_OaEvectionList_ID_ID_EvectionID.GetDisplayString(dr["Province"].ToString(), "normal", "", DBConnID, "" )</td><td data-title="市" >@bWorkFlowForm_OaEvectionList_ID_ID_EvectionID.GetDisplayString(dr["City"].ToString(), "normal", "", DBConnID, "" )</td><td data-title="区" >@bWorkFlowForm_OaEvectionList_ID_ID_EvectionID.GetDisplayString(dr["Area"].ToString(), "normal", "", DBConnID, "" )</td><td data-title="距离" >@bWorkFlowForm_OaEvectionList_ID_ID_EvectionID.GetDisplayString(dr["Distance"].ToString(), "normal", "", DBConnID, "" )</td><td data-title="交通工具" >@bWorkFlowForm_OaEvectionList_ID_ID_EvectionID.GetDisplayString(dr["Vehicle"].ToString(), "normal", "", DBConnID, "" )</td><td><input type="button" class="mybutton" value="编辑" data-id="@dr["ID"]" onclick="subtable_editrow_OaEvectionList_ID_ID_EvectionID('@dr["ID"]');" style="margin-right:4px;" name="flowsubtable_OaEvectionList_ID_ID_EvectionID_editbutton" /><input type="button" class="mybutton" value="删除" onclick="subtable_deleterow_OaEvectionList_ID_ID_EvectionID('@dr["ID"]');" name="flowsubtable_OaEvectionList_ID_ID_EvectionID_editbutton"/></td></tr>}}</tbody></table></div></td></tr><tr id="EveCity" style="display:none"><td rowspan="1" colspan="1" style="word-break: break-all;" valign="middle" align="left"><p class="txt">出差省市与地区</p><input id="OaEvection.Area1" type1="flow_selectdiv" name="OaEvection.Area1" value="" style="width:55%" appid="11103689-746c-4289-9aaf-9c77aff4e01d" titlefield="City" pkfield="City" paramsvalue="" paramsname="" type="text" isflow="1" class="myselectdiv" title=""/></td><td class="Tradio" rowspan="1" colspan="1" style="word-break: break-all;" valign="middle" align="left"><p class="txt">总公里数</p><input id="OaEvection.GesamtKm1" type1="flow_text" name="OaEvection.GesamtKm1" value="" style="width:20%;text-align:left;" valuetype="4" type="text" isflow="1" class="mytext" title="" align="left"/></td></tr><tr id="FiveArea" style="display:none"><td rowspan="1" colspan="1" style="word-break: break-all;" valign="middle" align="left"><p class="txt">出差区域</p><select class="myselect" id="OaEvection.Area2" name="OaEvection.Area2" isflow="1" type1="flow_select"><option value="莱山区">莱山区</option><option value="芝罘区">芝罘区</option><option value="福山区">福山区</option><option value="高新区">高新区</option><option value="开发区">开发区</option></select></td><td class="Tradio" rowspan="1" colspan="1" style="word-break: break-all;" valign="middle" align="left"><p class="txt">总公里数</p><input id="OaEvection.GesamtKm2" type1="flow_text" name="OaEvection.GesamtKm2" value="" style="width:20%;text-align:left;" valuetype="4" type="text" isflow="1" class="mytext" title="" align="left"/></td></tr><tr><th class="titleT" rowspan="1" colspan="2" valign="middle" align="left"><p class="titleO">开车出差</p></th></tr><tr class="topTr"><td class="top" rowspan="1" colspan="1"><p class="txt">开车人姓名</p><input type="text" id="OaEvection.driver" type1="flow_text" name="OaEvection.driver" value="" valuetype="0" isflow="1" class="mytext" title="" align="0"/></td><td class="top"><p class="txt">车牌号</p><input id="OaEvection.LicensePlate" type1="flow_text" name="OaEvection.LicensePlate" value="" valuetype="0" type="text" isflow="1" class="mytext" title="" align="0"/></td></tr><tr><td colspan="1" rowspan="1" style="word-break: break-all;" valign="middle"><p class="txt">申请费用</p><input type="text" id="OaEvection.ApplyForMoney" type1="flow_text" name="OaEvection.ApplyForMoney" value="" valuetype="4" isflow="1" class="mytext" title="" align="left"/></td><td colspan="1" rowspan="1" valign="left"><p class="txt">财务审核费用</p><input id="OaEvection.AuditMoney" type1="flow_text" name="OaEvection.AuditMoney" value="" valuetype="0" type="text" isflow="1" class="mytext" title="" align="left"/></td></tr><tr class="bottomTr"><td class="bottom" colspan="2" rowspan="1" valign="top"><span class="txt">说明：此申请表作为出差申请、借款、核销必备的凭证。 </span></td></tr></tbody></table>